﻿using Microsoft.IdentityModel.Tokens;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WinFromTools
{
    public partial class JwtForm : Form
    {
        public JwtForm()
        {
            InitializeComponent();
        }

        private void btnEncode_Click(object sender, EventArgs e)
        {
            txtResult.Text = Base64UrlEncoder.Encode(txtHeader.Text);
        }

        private void btnDecode_Click(object sender, EventArgs e)
        {
            //Base64UrlEncoder.Encode(SerializeToJson());

            txtResult.Text = Base64UrlEncoder.Decode(txtHeader.Text);
        }

        private void btnPayloadEncode_Click(object sender, EventArgs e)
        {

        }

        private void btnPayloadDecode_Click(object sender, EventArgs e)
        {
            txtResult.Text = Base64UrlEncoder.Decode(txtPayload.Text);
        }

        private void btnEpochTime_Click(object sender, EventArgs e)
        {
            txtResult.Text = EpochTime.GetIntDate(DateTime.Now).ToString();
        }
    }
}
